<template>
  <view class="content" style="padding-top: 0upx;">

    <noteList ref="noteListRef"></noteList>
  </view>
</template>
<script>
import noteList from '@/pages/index/noteList.vue'
import uniCountdown from '@/components/uni-countdown/uni-countdown.vue'
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'

import {goods} from '@/config/mixins.js'

export default {
  mixins: [goods],
  components: {
    noteList,
    uniCountdown
  },
  data() {
    return {}
  },
  computed: {
    appTitle() {
      return this.$store.state.config.shop_name
    }

  },
  onLoad(e) {
    console.info("检查更新:", checkUpdate())
    checkUpdate().then(res => {
      console.info("检查更新:", res)
    })
  },
  onShow() {
    this.initData()
  },
  methods: {

    destroyed() {
      window.removeEventListener('scroll', this.handleScroll)
    },
    goSearch() {
      uni.navigateTo({
        url: './search'
      })
    },
    // 首页初始化获取数据
    initData() {
      //获取首页配置

      this.getMyShareCode();
    },
    getMyShareCode() {
      let userToken = this.$db.get("userToken");
      if (userToken && userToken != '') {
        // 获取我的分享码
      }
    }
  },
  onReachBottom() {
    console.info("加载更多2")
    this.$refs.noteListRef.getNoteList("next");
  },
  onPullDownRefresh() {
    console.info("加载更多23")
    this.$refs.noteListRef.getNoteList("one");
    uni.stopPullDownRefresh()
  },

  //分享
  onShareAppMessage() {
    let myInviteCode = this.myShareCode ? this.myShareCode : '';
    let ins = this.$common.shareParameterDecode('type=1&invite=' + myInviteCode);
    let path = '/pages/share/jump?scene=' + ins;
    return {
      title: this.$store.state.config.share_title,
      // #ifdef MP-ALIPAY
      desc: this.$store.state.config.share_desc,
      // #endif
      imageUrl: this.$store.state.config.share_image,
      path: path
    }
  }
}
</script>

<style>
.search {
  /* position: fixed; */
  /*  #ifdef  H5  */
  /* top: 44px; */
  /*  #endif  */
  /*  #ifndef  H5  */
  /* top: 0; */
  /*  #endif  */
}

.cell-item {
  border: none;
}

.cell-ft-text {
  font-size: 22 upx;
  color: #999;
}

/* .new-goods {
  min-height: 300upx;
  white-space: nowrap;
  width: 100%;
}

.new-goods-item {
  width: 200upx;
  display: inline-block;
  margin-right: 20upx;
}

.new-goods-item:last-child {
  margin-right: 0;
}

.news-goods-img {
  width: 200upx;
  height: 200upx;
}

.news-goods-img image {
  width: 100%;
  height: 100%;
}

.news-goods-bot {
  margin-top: 6upx;
}

.new-goods-name {
  display: block;
  font-size: 26upx;
}

.new-goods-price {
  display: block;
  font-size: 26upx;
  color: #e14d4d;
} */
</style>
